home *** CD-ROM | disk | FTP | other *** search
/ Radio Active - The Music Trivia Game Show / Radio Active - The Music Trivia Game Show (1994)(Sanctuary Woods).iso / radactiv / radactiv.dir / 00805_Field_805.txt < prev    next >
Text File  |  1994-11-20  |  3KB  |  67 lines

  1. --[1How many sounds used,2number of sounds on disk,3EdgeInc--Running count of the number of times this class of sound file is called, 4EdgeWhen--how often Edge appears,5EDGELImit--number of edge files on disk,6EdgeUsed--Random list of EdgeFiles that are unused]
  2.  
  3.  
  4. on IncSnd thesnd
  5.   global SndList,SndLimitList,BobbyMuzzle
  6.   --global SndVals,SoundUsed,SoundLimit,EdgeInc,EdgeWhen,EdgeLimit,EdgeUsed
  7.   if BobbyMuzzle = true then
  8.     return makeAPath (theSnd & "@" & TheSnd & 1)
  9.     exit
  10.   end if
  11.   put GetAProp(SndList,TheSnd) into SndVals
  12.   put GetAt(SndVals,1) into SoundUsed
  13.   put GetAt(SndVals,2) into SoundLimit
  14.   put GetAt(SndVals,3) into EdgeInc
  15.   put GetAt(SndVals,4) into EdgeWhen
  16.   put GetAt(SndVals,5) into EdgeLimit
  17.   put GetAt(SndVals,6) into EdgeUsed
  18.   --put "EdgeUsed" && EdgeUsed
  19.   -- put "EdgeLimit" && EdgeLimit
  20.   --first check to see if it is time to use an "Edge" sound
  21.   --we increment EdgeUsed first, every time the sound file is called.
  22.   
  23.   set EdgeInc = EdgeInc + 1
  24.   --put "EdgeStuff" && EdgeInc && EdgeWhen
  25.   if Edgewhen > 0 AND EdgeInc mod EdgeWhen = 0 then  
  26.     --if EdgeWhen is 0, then there are no edge files.  Skip to normal sounds.
  27.     -- for example, if its every 7th time, then if EdgeInc = 14 and EdgeWhen = 7 then 
  28.     --its time for an edge file, so we get the next edge file and use it
  29.     
  30.     
  31.     set EdgeNum = GetAt(EdgeUsed,1)
  32.     DeleteAt EdgeUsed,1 
  33.     if count(EdgeUsed) = 0 then
  34.       Set EdgeUsed = MakeRandList(EdgeLimit)
  35.       --makes a new random list from which to pull Edge files.
  36.     end if
  37.     
  38.     --now reLoad the mySnd list with the values that have changed
  39.     
  40.     --put "SndVals" && SndVals
  41.     SetAt(SndVals,3,EdgeInc)
  42.     SetAt(SndVals,6,EdgeUsed)
  43.     SetaProp(Sndlist,value(TheSnd),SndVals)    
  44.     
  45.     --put makeAPath (thesnd & "@Edge@" & thesnd & EdgeNum)
  46.     return makeAPath (thesnd & "@Edge@" & thesnd & EdgeNum)
  47.   else
  48.     
  49.     --its not time for an "EDGE" file, so increment the normal sound file and use it.
  50.     -- put "SoundUsed" && soundUsed
  51.     --put count(soundUsed)
  52.     
  53.     put GetAt(soundUsed,1) into SU
  54.     DeleteAt value(SoundUsed),1 
  55.     if count(SoundUsed) = 0 then
  56.       set SoundUsed = MakeRandList(SoundLimit)
  57.     end if
  58.     --now reLoad the SndVals list with the value that has changed
  59.     SetAt(SndVals,1,SoundUsed)
  60.     SetAt(SndVals,3,EdgeInc)
  61.     SetaProp(Sndlist,value(TheSnd),SndVals)
  62.     
  63.     --put makeAPath (theSnd & "@"& TheSnd & SU)
  64.     return makeAPath (theSnd & "@" & TheSnd & SU)
  65.   end if
  66. end IncSnd
  67.